package cn.thornbird.orgsync.model;

import org.springframework.security.core.GrantedAuthority;

public class Resource implements GrantedAuthority {

    private static final long serialVersionUID = 3645606450023765999L;

    private final String authority;

    public Resource(String authority) {
        this.authority = authority;
    }

    @Override
    public String getAuthority() {
        return authority;
    }

    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (object instanceof Resource) {
            return this.authority.equals(((Resource) object).authority);
        }
        return false;
    }

    public int hashCode() {
        return this.authority.hashCode();
    }

    public String toString() {
        return this.authority;
    }

}
